home *** CD-ROM | disk | FTP | other *** search
- Subject: Re: ODF R1 RefCounting Extensio
- Sent: 5/30/96 5:00 PM
- Received: 5/30/96 5:21 PM
- From: Henri Lamiraux, lamiraux@apple.com
- Reply-To: ODF Interest, ODF-Interest@CILabs.ORG
- To: OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
-
- >In ODF R1, calling FW_CExtensionManager::AcquireExtension() for our extension
- >never Acquire()'s the extension if it has to create it, so the refcount
- >remains 0, and a subsequent Release() leads to a warning from OpenDoc. For a
- >cached part such as ours, subsequent uses of the extension don't have a
- >problem because FW_CExtensionManager::AcquireExtension() does Acquire() the
- >extension if it is only retrieving it from the cache.
- >
- >I suspect that the line:
- >
- > acquiredExtension->Acquire(ev);
- >
- >should be inserted into the following code in
- >FW_CExtensionManager::AcquireExtension:
- >
- > if (pair->fValue.fCreateFunction)
- > {
- > acquiredExtension = (pair->fValue.fCreateFunction)
- > (ev, fPart, name, pair->fValue.fRefCon);
- > acquiredExtension->Acquire(ev); // New line to increment refcount
- > pair->fValue.fExtension = acquiredExtension;
- > }
- >
- >Alternatively, the extension's CreateFunction could Acquire() the extension,
- >but the documentation does not indicate this and it seems inappropriate to
- >me. One might want to create the extension before there are any clients (for
- >caching purposes, for instance).
- >
- >Is this a bug in FW_CExtensionManager::AcquireExtension, or have I missed
- >something?
- >
- >Kirk Swenson
- >Senior Software Engineer
- >Key Curriculum Press
- >kswenson@keypress.com
- >
-
- Greg Friedman should be answering this question but I though that
- refcounted objects in OpenDoc were created with a refcount of 1? When you
- create an ODShape (subclass of ODRefcounted object) it's refcount is 1. I
- am just wondering why your refcount is 0. A refcount of zero means the
- object is gone.
-
- .......................................................................
- Henri Lamiraux lamiraux@apple.com
- Apple Computer, Inc. OpenDoc(tm) Development Framework
- .......................................................................
-
-